package com.scs.application.modules.dept.controller;

import com.scs.application.core.mvc.controller.FlowController;
import com.scs.application.modules.sys.model.RestResult;
import org.springframework.web.bind.annotation.*;

import com.scs.application.modules.dept.service.MonthlyBalanceService;
import com.scs.application.modules.dept.entity.MonthlyBalance;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * <p>
 * 仓库月结表 前端控制器
 * </p>
 */
@RestController
@RequestMapping("/dept/monthly_balance")
public class MonthlyBalanceController extends FlowController<MonthlyBalanceService, MonthlyBalance> {

    @GetMapping("/preview")
    public void preview(@RequestParam(name = "id") String id,
                        HttpServletResponse response) throws IOException {
//        service.preview(id, response);
    }


    @PostMapping("/save_monthly_balance")
    public RestResult preview(@RequestBody MonthlyBalance monthlyBalance) throws IOException {
        MonthlyBalance entity = service.saveMonthlBalance(monthlyBalance);
        return RestResult.ok("数据保存成功",entity);

    }
}
